<?php
class whyshopseckill_finder_whyshopseckill{
    public $column_editbutton = '编辑';
 
    // seckill_application_pass
    public function __construct($app)
    {
        $this->app = $app;
        $this->detail_basic = app::get('b2c')->_('秒杀活动信息');
        $this->render = $this->app->render();

    }
    public function column_editbutton($row){
        return '<a href="index.php?app=whyshopseckill&ctl=admin_whyshopseckill&act=edit&whyshopseckill_id='.$row['whyshopseckill_id'].'&_finder[finder_id]=' . $_GET['_finder']['finder_id'] . '&finder_id='.$_GET['_finder']['finder_id'].'" target="_blank"><span>'.app::get('ectools')->_('编辑').'</span></a>';

        /*'target'=>'dialog::{title:\''.app::get('whyshopseckill')->_('添加或编辑申请信息').'\',width:700,height:300}'*/
    }

   
    // target="dialog::{title:\''.app::get('whyshopseckill')->_('编辑活动信息').'\',width:700,height:300}"

    function detail_basic($id){
        $arr = $this->app->model('whyshopseckill')->dump($id);
        $this->render->pagedata['whyshopseckill'] = $arr;
        $filter['whyshopseckill_id']=$id;
        //取当前秒杀活动下的所有秒杀商品信息
        $arr_goods = $this->app->model('whyshopseckill_goods')->getList('*',$filter,0,-1);

        foreach ($arr_goods as $key => $value) {
            # code...
            $filter['goods_id']=$value['seckill_goods_id'];
             $arr_goods_name = app::get('b2c')->model('goods')->getList('*',$filter,0,-1);
             $name=$arr_goods_name[0]['name'];
             $arr_goods[$key]['goods_name']=$name;

            
            
        }
       
        $this->render->pagedata['arr_goods5'] = $arr_goods;

       
        $o_goods = $this->app->model('whyshopseckill_goods');
        $this->render->pagedata['arr_goods_name5'] = $arr_goods_name;

        return $this->render->fetch('admin/whyshopseckill/detail.html');
    }
}
